const raw = {
  primary: [
    {
      url: "",
      name: "数字湾区",
      id: 1,
      key: 'X5F_SZWQ',
      color: "#D86450",
    },
    {
      url: "",
      name: "主宾省专区",
      id: 2,
      key: 'X5F_ZBSZ',
      color: "#67C0C9",
    },
    {
      url: "KJ-DRHrGGIdEjF",
      name: "博览会主题打卡点",
      id: 3,
      key: 'X5F_RUKOU',
      color: "#CC9160",
    },
    {
      url: "",
      name: "A区",
      id: 4,
      key: "X5F_A",
      color: "#DDBC6B",
    },
    {
      url: "KJ-4FREbPJLDLE&lang=zh&pose=pano:6,qua:-0.0092,0.7029,0.0091,0.7112",
      name: "发布台",
      id: 5,
      key: 'X5F_CGFBT',
      color: "#916CE5",
    }
  ],
  secondary: [
    {
      p_id: 1, //对应primary的id
      bgclr: "#FFB797",
      textColor: '#AD3936',
      data: [
        {
          xuhao: "",
          key: "1_1",
          url: "KJ-DRHrGGIdEjF&lang=zh&pose=pano:58,qua:-0.0059,0.6822,0.0055,0.7311",
          name: "广东",
          id: 1,
        },
        {
          xuhao: "",
          url: "KJ-DRHrGGIdEjF&lang=zh&pose=pano:80,qua:0.0484,0.8659,-0.0855,0.4905",
          name: "广州",
          id: 2,
          key: "3_1"
        },
        {
          xuhao: "",
          url: "KJ-DRHrGGIdEjF&lang=zh&pose=pano:22,qua:0.0837,0.5143,-0.0505,0.852",
          name: "深圳",
          id: 3,
          key: "2_2"
        },
        {
          xuhao: "",
          url: "KJ-DRHrGGIdEjF&lang=zh&pose=pano:8,qua:0.0008,0.707,-0.0008,0.7073",
          name: "各地市",
          id: 4,
          key: "4_1"
        },
        {
          xuhao: "",
          url: "KJ-DRHrGGIdEjF&lang=zh&pose=pano:148,qua:0.0956,0.1522,-0.0148,0.9836",
          name: "澳门",
          id: 5,
          key: "6_1"
        },
        {
          xuhao: "",
          url: "KJ-DRHrGGIdEjF&lang=zh&pose=pano:186,qua:0.0033,0.9885,-0.0217,0.1497",
          name: "行动方案主题展",
          id: 6,
          key: "5_2"
        },
      ],
    },
    {
      p_id: 2, //对应primary的id
      bgclr: "#9EF5FF",
      textColor: '#448C8C',
      data: [
        {
          xuhao: "",
          url: "KJ-0HlHssosRIQ&lang=zh&pose=pano:106,qua:0.0565,-0.4574,0.0291,0.887",
          name: "安徽",
          id: 1,
          key: "2_1"
        },
        {
          xuhao: "",
          url: "KJ-0HlHssosRIQ&lang=zh&pose=pano:106,qua:0.0565,-0.4574,0.0291,0.887",
          name: "新疆",
          id: 2,
          key: "1_1"
        },
        {
          xuhao: "",
          url: "KJ-0HlHssosRIQ&lang=zh&pose=pano:82,qua:-0.001,0.9928,-0.1193,-0.0086",
          name: "江西",
          id: 3,
          key: "4_1"
        },
        {
          xuhao: "",
          url: "KJ-0HlHssosRIQ&lang=zh&pose=pano:118,qua:0.1431,0.0177,-0.0026,0.9895",
          name: "广西",
          id: 4,
          key: "3_1"
        }
      ],
    },
    {
      p_id: 3, //对应primary的id
      bgclr: "#FFCFA8",
      textColor: '#A5704C',
      data: [
        {
          xuhao: "",
          url: "",
          name: "博览会主题打卡点",
          id: 1,
        }
      ],
    },
    {
      p_id: 4, //对应primary的id
      bgclr: "#FDE5AA",
      textColor: '#CC9C23',
      data: [
        {
          xuhao: "A1",
          url: "KJ-Pwtyaw96JFJ&lang=zh&pose=pano:130,qua:0.114,0.006,-0.0007,0.9935",
          name: "中国建设银行",
          id: 1,
        },
        {
          xuhao: "A2",
          url: "KJ-4FREbPJLDLE&lang=zh&pose=pano:236,qua:-0.0001,0.9986,-0.0524,-0.0029",
          name: "中国电子信息产业集团有限公司",
          id: 2,
        },
        {
          xuhao: "A3",
          url: "KJ-Pwtyaw96JFJ&lang=zh&pose=pano:140,qua:0.0491,-0.183,0.0092,0.9818",
          name: "中国电信集团公司",
          id: 3,
        },
        {
          xuhao: "A4",
          url: "KJ-4FREbPJLDLE&lang=zh&pose=pano:204,qua:0.0104,0.9029,-0.0219,0.4291",
          name: "中国联合网络通信集团有限公司",
          id: 4,
        },
        {
          xuhao: "A5",
          url: "KJ-Pwtyaw96JFJ&lang=zh&pose=pano:78,qua:0.0692,-0.6964,0.0678,0.7111",
          name: "中国南方电网有限责任公司",
          id: 5,
        },
        {
          xuhao: "A6",
          url: "KJ-4FREbPJLDLE&lang=zh&pose=pano:80,qua:0.0616,-0.713,0.0631,0.6956",
          name: "中国移动通信集团有限公司",
          id: 6,
        },
        {
          xuhao: "A7",
          url: "KJ-Pwtyaw96JFJ&lang=zh&pose=pano:70,qua:0.1245,-0.0071,0.0009,0.9922",
          name: "华为技术有限公司",
          id: 7,
        },
        {
          xuhao: "A9",
          url: "KJ-Pwtyaw96JFJ&lang=zh&pose=pano:56,qua:0.0784,-0.0064,0.0005,0.9969",
          name: "深圳市腾讯计算机系统有限公司",
          id: 8,
        },
        {
          xuhao: "A10",
          url: "KJ-4FREbPJLDLE&lang=zh&pose=pano:118,qua:0.1008,0.6907,-0.0981,0.7093",
          name: "蚂蚁科技集团股份有限公司",
          id: 9,
        },
        {
          xuhao: "A11",
          url: "KJ-Pwtyaw96JFJ&lang=zh&pose=pano:54,qua:0.1197,-0.0061,0.0007,0.9928",
          name: "中兴通讯股份有限公司",
          id: 10,
        },
        {
          xuhao: "A13",
          url: "KJ-Pwtyaw96JFJ&lang=zh&pose=pano:26,qua:0.0674,0.1894,-0.013,0.9795",
          name: "中国邮政集团有限公司",
          id: 11,
        },
        {
          xuhao: "A14",
          url: "KJ-0HlHssosRIQ&lang=zh&pose=pano:2,qua:0.0147,-0.4918,0.0083,0.8705",
          name: "深信服科技股份有限公司",
          id: 12,
        },
        {
          xuhao: "A15",
          url: "KJ-0HlHssosRIQ&lang=zh&pose=pano:44,qua:-0.049,0.8755,-0.0909,-0.4721",
          name: "新华三技术有限公司",
          id: 13,
        },
        {
          xuhao: "A16",
          url: "KJ-4FREbPJLDLE&lang=zh&pose=pano:56,qua:-0.013,0.7161,0.0133,0.6977",
          name: "杰创智能科技股份有限公司",
          id: 14,
        },
        {
          xuhao: "A17",
          url: "KJ-4FREbPJLDLE&lang=zh&pose=pano:22,qua:0.0292,0.6716,-0.0265,0.7398",
          name: "广州力麒智能科技有限公司",
          id: 15,
        }
      ],
    },
    {
      p_id: 5, //对应primary的id
      bgclr: "#CCB5FF",
      textColor: '#624AC6',
      data: [
        {
          xuhao: "",
          url: "",
          name: "成果发布台",
          id: 1,
        }
      ],
    },
  ],
};

let loop = (main, sub) => {
  let data = main.map((item) => {
    sub.forEach((sub) => {
      if (item.id === sub.p_id) {
        item.sub = sub;
        item.show = false;
      }
    });
    return item;
  });

  return data;
};

let data = loop(raw.primary, raw.secondary);

module.exports = {
  data,
  raw,
};
